<?php
namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-StoreValidate
 * Class StoreValidate
 * @package app\validate
 */
class StoreValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require|number|notIn:0',
        'user_id|用户id' => 'require|number|notIn:0',
        'grade_id|模板id' => 'require|number|notIn:0',
        'store_status|店铺状态' => 'number|in:0,1',
        'check_status|审核状态' => 'number|in:0,1,2',
        'store_name|商家名称' => 'require|max:20',
        'store_type|商家类型' => 'number|in:0,1',
        'store_deposit|保证金' => 'float',
        'sort|排序' => 'number',
        'store_workingtime|工作时间' => 'max:20',
        'is_own_shop|是否自营' => 'in:0,1',
        'store_top|推广id' => 'number',
        'popularize_code|邀请码' => 'max:20',
        'store_desc|商家介绍' => 'max:300',
        'store_scope|经营范围' => 'max:300',
        'real_name|真实姓名' => 'require|max:5',
        'contact_phone|联系电话' => 'require|mobile',
    ];

    //验证场景-审核状态
    public function sceneUpCheckStatus()
    {
        return $this->only(['id','check_status']);
    }

    //验证场景-审核状态
    public function sceneUpStoreStatus()
    {
        return $this->only(['id','store_status']);
    }
}
